- @force_fluid_layout = true
- add_to_breadcrumbs _('Pipelines'), project_pipelines_path(@project)
- breadcrumb_title "##{@pipeline.id}"
- page_title sprintf(s_("Pipeline|Pipeline #%{pipeline_id}"), {pipeline_id: @pipeline.id})
- pipeline_has_errors = @pipeline.builds.empty? && @pipeline.error_messages.any?
- add_page_specific_style 'page_bundles/pipeline'
- add_page_specific_style 'page_bundles/reports'
- add_page_specific_style 'page_bundles/ci_status'
- add_page_startup_graphql_call('pipelines/get_pipeline_details', { projectPath: @project.full_path, iid: @pipeline.iid })

#js-pipeline-header{ data: js_pipeline_header_data(@project, @pipeline) }

- if pipeline_has_errors
  - has_composite_identity_forbidden = @pipeline.composite_identity_forbidden?
  - has_identity_verification_error = @pipeline.user_not_verified?
  - if has_composite_identity_forbidden
    = render Pajamas::AlertComponent.new(title: s_('Pipelines|Unable to run pipeline'),
      variant: :warning,
      dismissible: false,
      alert_options: { class: 'gl-my-5' }) do |c|
      - c.with_body do
        %p.gl-my-4= @pipeline.failure_reason
        - settings_link = link_to('', project_settings_ci_cd_path(@project, anchor: 'js-general-pipeline-settings'))
        %p= safe_format(s_('Pipelines|To enable automatic pipeline execution for composite identities, visit %{link_start}CI/CD Settings.%{link_end}'), tag_pair(settings_link, :link_start, :link_end))
      - c.with_actions do
        - path = @pipeline.merge_request.present? ? diffs_project_merge_request_path(@project, @pipeline.merge_request, commit_id: @pipeline.commit.id) : project_commit_path(@project, @pipeline.commit)
        = render Pajamas::ButtonComponent.new(href: path, variant: :confirm) do
          = s_("Pipelines|Verify changes")
  - elsif !has_identity_verification_error
    = render Pajamas::AlertComponent.new(title: s_('Pipelines|Unable to run pipeline'),
      variant: :danger,
      dismissible: false,
      alert_options: { class: 'gl-my-5' }) do |c|
      - c.with_body do
        %ul
          - @pipeline.error_messages.pluck(:content).each do |error| # rubocop:disable CodeReuse/ActiveRecord -- done temporarily to drop yaml_errors
            %li= error
        - if can_view_pipeline_editor?(@project)
          = render Pajamas::ButtonComponent.new(href: project_ci_pipeline_editor_path(@project, branch_name: @pipeline.source_ref), variant: :confirm) do
            = s_("Pipelines|Go to the pipeline editor")

- else
  #js-pipeline-tabs{ data: js_pipeline_tabs_data(@project, @pipeline, @current_user) }
